﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreShop.Model;
using CoreShop.Repository;
using SqlSugar;
using Yitter.IdGenerator;

namespace CoreShop.Services
{
    /// <summary>
    ///  接口实现
    /// </summary>
    public class corecmsfoodgroupdetailServices : Repository<corecmsfoodgroupdetail>
    {
        public bool InsertAsync(corecmsfoodgroupdetail entity)
        {
            return base.Change<corecmsfoodgroupdetail>().Insert(entity);
        }
        public bool InsertOrUpdate(List<corecmsfoodgroupdetail> entity)
        {
            return base.InsertOrUpdate(entity);
        }
 

        /// <summary>
        /// 重写删除指定ID的数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DeleteByIdAsync(long id)
        {
            return base.Change<corecmsfoodgroupdetail>().DeleteById(id);
        }

        ///// <summary>
        ///// 重写删除指定ID集合的数据(批量删除)
        ///// </summary>
        ///// <param name="ids"></param>
        ///// <returns></returns>
        //public bool DeleteByIdsAsync(int[] ids)
        //{ 
        //   return base.Change<corecmsfoodgroupdetail>().Delete(p=>p.foodId);
        //}
 
    }
}